package org.example.guide.persistence;

import org.apache.ibatis.annotations.*;
import org.example.guide.domain.Guide;
import org.example.guide.domain.Transaction;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface transactionMapper {
    @Select("SELECT * FROM transaction where transaction.TransactionType = '资格升级' ")
    List<Transaction> selectAllUpgrade();
    @Select("SELECT * FROM transaction where transaction.TransactionType = '资格注册' ")
    List<Transaction> selectAllRegister();
    @Select("SELECT * FROM transaction where transaction.TransactionType = '应聘报备' ")
    List<Transaction> selectAllReport();
    @Select("SELECT * FROM transaction where transaction.TransactionType = '行程单申领' ")
    List<Transaction> selectAllApply();
     @Select("SELECT * FROM guidemsg where guidemsg.id = #{id} ")
     Guide selectGuideById(@Param("id")int id);
    @Delete("DELETE FROM transaction where transaction.ID = #{id} ")
    void deleteById(int id);

    @Update("UPDATE  guidemsg SET Qualification = #{Qualification} WHERE guidemsg.id = #{ID}")
    void updateQualification(int ID, String Qualification);
    @Update("UPDATE  guidemsg SET Status = '已注册通过' WHERE guidemsg.id = #{ID}")
    void updateStatus(int ID);
    @Update("UPDATE  guidemsg SET TeamID = #{TeamID} WHERE guidemsg.id = #{ID}")
    void updateTeamID(int ID, int TeamID);


}
